#pragma once

//#define DEBUGMODE
#define DEBUGDELAY		500
#define FRAMERATE		30/1000

//victory conditions
#define CAPTURES_TO_WIN 5
#define LINE_WIN_SIZE	5

//Colors (Win console)
#define makeColor( fore, back ) ( fore | ( back << 4 ) ) //added parentheses to keep these operations within themselves
#define getColorBG( color ) ( color >> 4 )
#define getColorFore( color ) ( ( color << 4 ) >> 4 )

#define	BLACK			0 
#define	BLUE			1
#define	GREEN			2
#define	AQUA			3
#define	RED				4
#define	PURPLE			5
#define	YELLOW			6
#define	WHITE			7
#define	GRAY			8
#define	BRIGHTBLUE		9
#define	BRIGHTGREEN		10
#define	BRIGHTAQUA		11
#define	BRIGHTRED		12
#define	BRIGHTPURPLE	13
#define	BRIGHTYELLOW	14
#define	BRIGHTWHITE		15

//# of players moved to enum
//#define PLAYERS			2 

// GAME DEFINES
// alert codes for game rules
//---------------------------------------
//...
#define EXIT		   -1
// nothing significant happened
#define	CONTINUE		0
// 5 pieces in a row (horiz, vert, or diag) or 5 captures
#define PLAYER_WIN		1	

//state flags
enum GameStates {
	GAME_STATE_INIT,
	GAME_STATE_RUN,
	GAME_STATE_CONTINUE,
	GAME_STATE_WINNER,
	GAME_STATE_STALEMATE, // maybe this will be needed???
	GAME_STATE_EXIT,
	NUM_GAME_STATES
};

//Board defines
#define BOARD_X				0
#define BOARD_Y				0
#define BOARD_COLOR_SPACE	makeColor( WHITE, GRAY )
#define BOARD_COLOR_BLOCK	makeColor( YELLOW, GRAY )

// these defines were located in GamePiece.h
//---------------------------------------
/* changed to enum for PLAYERS -Kaero
#define PLAYER_ONE		0
#define PLAYER_TWO		1*/
enum {
	PLAYER_ONE,
	PLAYER_TWO,
	PLAYERS
};

#define PLAYER_ONE_COLOR makeColor( BRIGHTGREEN, getColorBG( BOARD_COLOR_SPACE ) )
#define PLAYER_TWO_COLOR makeColor( BRIGHTRED, getColorBG( BOARD_COLOR_SPACE ) )

//inputFlag Defines
//---------------------------------------
#define INPUT_W_KEY		0 // wasd movement keys
#define INPUT_A_KEY		1
#define INPUT_S_KEY		2
#define INPUT_D_KEY		3
#define INPUT_P_KEY		4 // print key
#define INPUT_R_KEY		5 // restart key
#define INPUT_ESC_KEY	6 // exit key
#define INPUT_ENTER_KEY 7 // select move
#define INPUT_SPACE_KEY 8 // select move

//Exit Message Coordinates
#define CONGRATS_X		0
#define CONGRATS_Y		20
#define EXIT_MSG_X		0
#define EXIT_MSG_Y		30

//Screen Defines
#define SCREEN_SIZE_X		110
#define SCREEN_SIZE_Y		58
#define SCREEN_EXTRA_LINES	130		//Extra lines in screen buffer... must be at least 1
#define GAME_TITLE			"==--..Pente!..--=="
#define SCREEN_CLEAR_CHAR	' '
#define COLOR_SCREEN		makeColor( BRIGHTYELLOW, BLACK )



#define BOARD_SIZE	19
#define NODE_ROW	3
#define NODE_COL	5

//directional node ptr defines aka cardinal directions
//Clockwise, where 0 is noon
enum Directions { //changed to enum for NUM_DIRECTIONS -Kaero
    NORTH,
	NORTH_EAST,
	EAST,
    SOUTH_EAST,
    SOUTH,
    SOUTH_WEST,
    WEST,
    NORTH_WEST,
	NUM_DIRECTIONS
};

//	Useful Character #'s
//--------------------------------------
//  blank square filler = 219
//	Hyphen = 45
//	Pipes = 124
//	cursor = 11 
//	snowflake = 15
//	node = 4 // diamonds
//  piece marker = 1 (empty), 2(filled)
//--------------------------------------
#define FILL_SQUARE 219
#define HORZ_LINE	45
#define VERT_LINE	124
#define CURSOR		11
#define NODE_CHAR	4
#define PLAYER_1	1
#define PLAYER_2	2

//Cursor Movement 
#define CURSOR_MOVE_UP		NORTH
#define CURSOR_MOVE_RIGHT	EAST
#define CURSOR_MOVE_DOWN	SOUTH
#define CURSOR_MOVE_LEFT	WEST